package com.work.cos.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.work.cos.mapper.base.IBaseMapper;
import com.work.cos.service.interfc.IBaseService;

public class BaseServiceImpl<M extends IBaseMapper<T>, T> implements IBaseService<T>{

	@Autowired
    protected M baseMapper;
	
	@Override
	public boolean save(T entity) {
		return baseMapper.save(entity) > 0;
	}

	@Override
	public boolean update(T entity) {
		return baseMapper.update(entity) > 0;
	}

	@Override
	public boolean delete(Long id) {
		return baseMapper.delete(id) > 0;
	}

	@Override
	public T getOne(Long id) {
		return baseMapper.getOne(id);
	}

	@Override
	public List<T> getList(Long userId) {
		return baseMapper.getList(userId);
	}

	@Override
	public List<T> getAllList() {
		return baseMapper.getAllList();
	}

}
